package org.unc.linamania;


public class FlickrTag {
	
	private String tagName;
	private int X = 0;
	private int Y = 0;
	private int width = 0;
	private int height = 0;	
	private PositionMap map;
	int xspeed = 1;
	int yspeed = 1;
	
	public FlickrTag(String name)
	{
		this.tagName = name;
		map = PositionMap.getInstance();
		X= map.getX();
		Y= map.getY();
		width = 18*name.length();
		height = 18;
		
	}
	
	public void setName(String name)
	{
		this.tagName = name;
	}
	
	public String getName()
	{
		return this.tagName;
	}
	
	public int getXCoordinate()
	{
		return X;
	}
	
	public int getYCoordinate()
	{
		return Y;

	}

	public int getWidth()
	{
		return width;
	}
	
	public int getHeight()
	{
		return height;
	}
	
	public void start()
	{
		if(xspeed == 0 && yspeed == 0)
		{
			xspeed = 1;
			yspeed = 1;
			
			if ((X+width) >= 780 || X <= 20 )
				xspeed = xspeed * (-1);
			if ((Y+height) >= 550 || Y <=20)
				yspeed = yspeed * (-1);	
		}

	}
	
}
